class BinaryTree:
    def __init__(self,rootObj):
        self.key=rootObj;
        self.leftChild=None;
        self.rightChild=None;
    def inisertLeft(self,newNode):
        if self.leftChild==None:
            self.leftChild=BinaryTree(newNode)
        else:
            t=BinaryTree(newNode)
            t.leftChild=self.leftChild
            self.leftChild=t
    def insertRight(self,newNode):
        if self.rightChild==None:
            self.rightChild=BinaryTree(newNode)
        else:
            t=BinaryTree(newNode)
            t.rightChild=self.rightChild
            self.rightChild=t
    def setRootVal(self,obj):
        self.key=obj
    def getRootVal(self):
        return self.key
    def getLeftChild(self):
        return self.leftChild
    def getRightChild(self):
        return self.rightChild

t=BinaryTree('a')
print(t.getRootVal())
print(t.getRightChild())

t.inisertLeft("b")
t.insertRight("c")
print(t.getLeftChild().getRootVal())
print(t.getRightChild().getRootVal())


t.getRightChild().setRootVal("d")
print(t.getRightChild().getRootVal())